                                #动手试一试
# 3-1 姓名
names = ['howie hsu', 'Tom smith', 'Cindy wang', 'Gray zhu']
print(names[0].title())
print(names[1].title())
print(names[2].title())
print(names[3].title())
# 3-2 问候语
message = "Hello, "
print( message + names[0].title() )
print( message + names[1].title() )
print( message + names[2].title() )
print( message + names[3].title() )
# 3-3 自己的列表
MyOwnList = ['bicycle', 'bus', 'taxi', 'Honda motorcycle']
message = "I would like to own a "
print( message + MyOwnList[0] )
print( message + MyOwnList[1] )
print( message + MyOwnList[2] )
print( message + MyOwnList[3] )
# 3-4 嘉宾名单
FriendList = ["Tom" , "Cindy", "May"]
# 3-5 修改名单
print(FriendList.pop(2) + "无法赴约")
FriendList.append("Peter")
print(FriendList)
print("向" + FriendList[0] + "发出邀请")
print("向" + FriendList[1] + "发出邀请")
print("向" + FriendList[2] + "发出邀请")
# 3-6 添加嘉宾
print("我们将邀请更多的嘉宾。")
FriendList.insert(0,"Mr.Smith")
FriendList.insert(2,"Kitty")
FriendList.insert(-1,"Otto")
print(FriendList)
print("向" + FriendList[0] + "发出邀请")
print("向" + FriendList[1] + "发出邀请")
print("向" + FriendList[2] + "发出邀请")
print("向" + FriendList[3] + "发出邀请")
print("向" + FriendList[4] + "发出邀请")
print("向" + FriendList[5] + "发出邀请")
# 3-7 缩减名单
print("很抱歉，由于新购买的餐桌无法及时送达，因此只能邀请两位嘉宾。")
print( FriendList.pop() + "，很抱歉无法邀请您来共进晚餐了" )
print( FriendList.pop() + "，很抱歉无法邀请您来共进晚餐了" )
print( FriendList.pop() + "，很抱歉无法邀请您来共进晚餐了" )
print( FriendList.pop() + "，很抱歉无法邀请您来共进晚餐了" )
print( FriendList[-1] + "，您依旧在受邀人之列！")
print( FriendList[-2] + "，您依旧在受邀人之列！")
print(FriendList)
print( "我邀请了" + str( len(FriendList) ) + "位嘉宾共进晚餐" )
del FriendList[0]
del FriendList[0]
print(FriendList)
# 3-8 放眼世界
MyFavoriteCountry = ['Singapore', 'Japan', 'China', 'Russia', 'America']
print(MyFavoriteCountry)
print( sorted(MyFavoriteCountry) )
print( sorted(MyFavoriteCountry, reverse = True) )
MyFavoriteCountry.reverse()
print(MyFavoriteCountry)
MyFavoriteCountry.reverse()
print(MyFavoriteCountry)
# 3-9 晚餐嘉宾
# 3-10 尝试使用各个函数